<?php

/*
 * CopyRight  : (C)2012-2099 HaoTeam Inc.
 * Document   : Config.php
 * Created on : 2022-5-12 14:21:20
 * Author     : Tiger <1192851302@qq.com>
 * Description: This is NOT a freeware, use is subject to license terms.
 *              这即使是一个免费软件,使用时也请遵守许可证条款,得到当时人书面许可.
 *              未经书面许可,不得翻版,翻版必究;版权归属 HaoTeam Inc;
 */

namespace app\api\controller;

use app\Request;
use app\models\AdminConfig;

/**
 * @title 全局配置
 * Class Config
 * Tiger <1192851302@qq.com> 2022-5-12 14:21:20
 */
class Config {

    /**
     * @title 分组配置
     * @description 请向后端获取ID
     * @author Tiger <1192851302@qq.com>
     * @url /api/config/get/:id
     * @method GET
     * @return array:数组值#
     */
    public function get(Request $request, $id) {
        return app('json')->successful(AdminConfig::getAll($id));
    }

    /**
     * @title 充值套餐
     * @description 充值套餐列表
     * @author Tiger <1192851302@qq.com>
     * @url /api/recharge/list
     * @method POST
     * @param name:limit type:int require:1 default:10 other: desc:每页数量
     * @param name:page type:int require:1 default:1 other: desc:页码
     * @return array:数组值#
     */
    public function recharge(Request $request) {
         return app('json')->successful(\app\models\Recharge::getList());
    }

}
